1. Field of the Invention
The present invention relates generally to systems and methods for image processing, and more particularly to systems and methods for scaling color signals within an image. Still more particularly, the present invention is a system and method for bit-masked color signal scaling.
2. Description of the Background Art
In image processing applications, an image is a set of picture elements, or pixels. Each pixel is represented by a computer word that contains a color signal. Referring now to FIG. 1A, a block diagram of a prior art embodiment of a color signal within a computer word is shown. The color signal comprises a red channel signal, a green channel signal, and a blue channel signal that occupy a left channel signal position, a center channel signal position, and a right channel signal position within the computer word. Each channel signal occupies or spans a predetermined number of bits within the computer word, referred to herein as the channel signal size. Those skilled in the art will recognize that the color signal shown in FIG. 1A represents a pixel according to the conventional Red-Green-Blue (RGB) pixel format. As shown in FIG. 1A, the size of the computer word is defined herein as 32 bits, and the channel signal size is defined herein as 8 bits. Thus, the blue channel signal spans bits b0 through b7 within byte 0 in FIG. 1A. Similarly, the green channel signal spans bits g0 through g7 within byte 1, and the red channel signal spans bits r0 through r7 within byte 2. Those skilled in the art will also recognize that additional pixel-specific information may be present in those portions of the computer word that do not contain the color signal, such as in byte 3 in FIG. 1A.
Before a given image is displayed, image interpolation, image compositing, and/or image shading operations may be required. In the event that such operations are required, each channel signal within each color signal must be scaled according to a multiplication signal associated with the color signal. The set of multiplication signals used to scale the color signals within the image is referred to herein as a multiplication image. Referring now to FIG. 1B, a block diagram of a prior art multiplication signal within a computer word is shown. Preferably, each multiplication signal occupies a number of bits equal to the channel signal size. Thus, in FIG. 1B, the multiplication signal spans eight bits, namely, bits m0 through m7 in byte 0 of the computer word, because the channel signal size is eight bits.
In the prior art, when a color signal is scaled according to a multiplication signal, each channel signal is "unpacked", or loaded into its own computer word. Next, each unpacked channel signal is multiplied by the multiplication signal, and is then normalized according to the channel signal size. Finally, each unpacked channel signal is "packed", or loaded, into the appropriate position within a computer word, thereby forming the scaled color signal.
Presently, image sizes of 1024 by 768 pixels are common. As technology improves, images will contain ever-greater numbers of pixels in an effort to improve image resolution. Each of the operations performed during color signal scaling requires a given amount of computational time to complete. Multiplication operations are particularly time-intensive. For example, a 32-bit multiplication operation may be more than ten times slower than a simpler 32-bit operation such as an addition operation.
As can be seen from the preceding discussion, the scaling of a color signal having a red channel signal, a green channel signal, and a blue channel signal requires three multiplication operations. Thus, for an image having 1024 by 768 pixels, more than 2 million multiplications are required for a single scaling of the color signals within the image. Some image processing applications, particularly those that are interactive, may require that the color signals within an image be scaled multiple times and as rapidly as possible. Due to the very large number of operations that must be performed, however, the overall amount of time required in the prior art to perform a single scaling upon the set of color signals within an image is undesirably long, even for small images.
What is needed is a means for color signal scaling that significantly reduces the time required to scale the set of color signals within an image.